using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace KbsUmlEditor
{
    public partial class FormLijnEdit : Form
    {
        string m_Naam;

        public string Naam
        {
            get { return m_Naam; }
            set { m_Naam = value; }
        }

        Point m_Begin;

        public Point Begin
        {
            get { return m_Begin; }
            set { m_Begin = value; }
        }

        Point m_Eind;

        public Point Eind
        {
            get { return m_Eind; }
            set { m_Eind = value; }
        }

        string m_BeginPuntType;

        public string BeginPuntType
        {
            get { return m_BeginPuntType; }
            set { m_BeginPuntType = value; }
        }

        string m_EindPuntType;

        public string EindPuntType
        {
            get { return m_EindPuntType; }
            set { m_EindPuntType = value; }
        }

        public FormLijnEdit()
        {
            InitializeComponent();
            button1.DialogResult = DialogResult.OK;
            button2.DialogResult = DialogResult.Cancel;

           
            textBoxBeginX.Text = m_Begin.X.ToString();
            textBoxBeginY.Text = m_Begin.Y.ToString();
            textBoxEindX.Text = m_Eind.X.ToString();
            textBoxEindY.Text = m_Eind.Y.ToString();
            if (m_BeginPuntType == "")
            {
                comboBoxBeginPunt.SelectedText = comboBoxBeginPunt.Items[0].ToString(); ;
                this.comboBoxEindPunt.SelectedText = comboBoxEindPunt.Items[0].ToString();
            }
            else
            {
                comboBoxBeginPunt.SelectedText = BeginPuntType;
                comboBoxEindPunt.SelectedText = EindPuntType;
            }
           
        }

        private void label1_Click(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {//ok
            try
            {
               
                m_Begin.X = int.Parse(textBoxBeginX.Text);
                m_Begin.Y = int.Parse(textBoxBeginY.Text);
                m_Eind.X = int.Parse(textBoxEindX.Text);
                m_Eind.Y = int.Parse(textBoxEindY.Text);
                m_BeginPuntType = comboBoxBeginPunt.Text;
                m_EindPuntType = comboBoxEindPunt.Text;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
           
        }

        private void button2_Click(object sender, EventArgs e)
        {//cancel
           
        }

        private void FormEdit_VisibleChanged(object sender, EventArgs e)
        {
           
            textBoxBeginX.Text = m_Begin.X.ToString();
            textBoxBeginY.Text = m_Begin.Y.ToString();
            textBoxEindX.Text = m_Eind.X.ToString();
            textBoxEindY.Text = m_Eind.Y.ToString();
            if (m_BeginPuntType == "")
            {
                comboBoxBeginPunt.SelectedText = comboBoxBeginPunt.Items[0].ToString(); ;
                this.comboBoxEindPunt.SelectedText = comboBoxEindPunt.Items[0].ToString();
            }
            else
            {
                comboBoxBeginPunt.SelectedText = BeginPuntType;
                comboBoxEindPunt.SelectedText = EindPuntType;
            }
            
        }

        
    }
}